<template>
  <div>
    <h1>第一个组件</h1>
    <button @click="fn">传递给第二给组件</button>
  </div>
</template>

<script>
import { bus } from "@/bus/index.js";
export default {
  data() {
    return {
      n: 123,
    };
  },
  methods: {
    fn() {
      bus.$emit("chuanzhi", this.n);
    },
  },
};
</script>

<style lang="scss" scoped>
</style>